package cn.jy.erp.util;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

/**
 * md5加密说法
 * @author Administrator
 *
 */
public class Md5Util {

	//加密次数
	public static final int HASHNUM = 1000;
	//盐值
	public static final String SOURCE = "yhptest";

	/**
	 * 加密算法
	 * @param content
	 * @return
	 */
	public static String hash(String content) {
		ByteSource source = ByteSource.Util.bytes(SOURCE);
		SimpleHash hash = new SimpleHash("md5",content, source, HASHNUM);
		return hash.toString();
	}
}
